package com.liuyanban.service.impl.user;

import java.util.Collection;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.liuyanban.dao.base.BaseDao;
import com.liuyanban.dao.user.PrivilegeDao;
import com.liuyanban.domain.user.Privilege;
import com.liuyanban.service.impl.base.BaseServiceImpl;
import com.liuyanban.service.user.PrivilegeService;

@Service("privilegeService")
public class PrivilegeServiceImpl extends BaseServiceImpl<Privilege> implements
		PrivilegeService {
	@Resource(name = "privilegeDao")
	private PrivilegeDao privilegeDao;

	@Override
	public BaseDao getBaseDao() {
		return this.privilegeDao;
	}

	@Override
	public Collection<Privilege> getPrivilegesByRoleid(Long rid) {
		return this.privilegeDao.getPrivilegesByRid(rid);
	}

	@Override
	public Collection<Privilege> getFunctionTreeByUid(Long userid) {
		return this.privilegeDao.getFunctionByUid(userid);
	}

}
